import React, { Suspense } from 'react';
import './App.css';
import Login from './pages/Login';
import { useRoutes, Link } from 'react-router-dom'
import routes from './router/routes';
import useRouteWithGuard from './hooks/useRouteWithGuard';
import LayoutBase from './Layout';


function App() {
  let element = useRouteWithGuard({ routes, tokenKey: 'qf-token' })
  return (
    <div className="app">
      <LayoutBase>
        <Suspense fallback={<h1>正在加载</h1>}>
          {element}
        </Suspense>
      </LayoutBase>
    </div>
  );
}

export default App;
